//-----------------------------------------------
//              生成代码不要修改
//-----------------------------------------------

using System.Collections.Generic;
using System.IO;
using System.Text;
using UnityEngine;

public class DecisionInfoCfg
{
    public int ID;    //		ID
    public int Type;    //		类型
    public int Idle;    //		默认监听
    public List<int> Data;    //		监听的数据

    public void Deserialize(DynamicPacket packet)
    {
        ID = packet.PackReadInt32();
        Type = packet.PackReadInt32();
        Idle = packet.PackReadInt32();
        Data = SheetGenCommonFunc.GetListInt(packet.PackReadString());
    }
}

public class DecisionInfoCfgMgr
{
    private static DecisionInfoCfgMgr mInstance;

    public static DecisionInfoCfgMgr Instance
    {
        get
        {
            if (mInstance == null)
            {
                mInstance = new DecisionInfoCfgMgr();
            }

            return mInstance;
        }
    }

    private Dictionary<int, DecisionInfoCfg> mDict = new Dictionary<int, DecisionInfoCfg>();

    public Dictionary<int, DecisionInfoCfg> Dict
    {
        get { return mDict; }
    }

    public void Deserialize(DynamicPacket packet)
    {
        int num = (int)packet.PackReadInt32();
        for (int i = 0; i < num; i++)
        {
            DecisionInfoCfg item = new DecisionInfoCfg();
            item.Deserialize(packet);
            if (mDict.ContainsKey(item.ID))
            {
                mDict[item.ID] = item;
            }
            else
            {
                mDict.Add(item.ID, item);
            }
        }
    }

    public DecisionInfoCfg GetDataByID(int id)
    {
        if (mDict.ContainsKey(id))
        {
            return mDict[id];
        }

        return null;
    }
}